<?php

function getSOAPResponse()
{
	try
	{
		global $user_id;
		$loginDetails = array('login' => "facebookuser", 'password' => "B00kOfFace");
		$soapClient = new SoapClient("http://soap.webapp4.uea.ac.uk:8080/services/WolfieWebService?wsdl",$loginDetails);

		// Setup the RemoteFunction parameters
		$ap_param = array( 'forceCacheRefresh' => true );

		$loans = $soapClient->__call("getPatronInformation", array($ap_param));
		return $loans->return;
	}
	catch (SoapFault $fault)
	{
	print_r($fault);
		return "<p>There was an error connecting to the UEA web service. Please try again later, or report the error to <a href=\"mailto:web@uea.ac.uk\">web@uea.ac.uk</a>.</p>";
	}

}



function performXSLTTransform($sXml, $xsltFileName)
{
	# LOAD XML FILE
	$XML = new DOMDocument();
	$XML->loadXML( $sXml );

	# START XSLT
	$xslt = new XSLTProcessor();
	$XSL = new DOMDocument();
	$XSL->load( $xsltFileName, LIBXML_NOCDATA);
	$xslt->importStylesheet( $XSL );

	#PRINT
	return $xslt->transformToXML( $XML );
}

?>

